#include "ublk.h"
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {
    if (argc < 6) {
        fprintf(stderr, "用法: %s <dev_id> <lba_map_path> <cache_dir> <registry_url> <repository>\n", argv[0]);
        fprintf(stderr, "示例: %s 0 /path/to/lba_map.bin /var/lib/ocis/blobs https://registry-1.docker.io library/redis\n", argv[0]);
        return 1;
    }

    int dev_id = atoi(argv[1]);
    const char* lba_map_path = argv[2];
    const char* cache_dir = argv[3];
    const char* registry = argv[4];
    const char* repo = argv[5];

    return ublk_daemon_run(dev_id, lba_map_path, cache_dir, registry, repo);
}